<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>保存账单数据</title>
    <script src="../static/js/jquery.json.js"></script>
    <script src="../static/js/jquery-2.1.1.js"></script>
</head>
<body>
<p>上传账单数据</p>
<form id="saveTransferRecord">
    <input type="text" id="transferAmount" style="width: 200px"/>转账金额
    <label>
        <input type="radio" name="transferType" value="0" aria-selected="true"/>微信
    </label>
    <label>
        <input type="radio" name="transferType" value="1"/>支付宝
    </label>
    <input id="payer" type="text" name="payer" value="YB"/>付款人
    <input id="receivPerson" name="receivPerson" type="text"/>收款人
    <input id="payDate" name="payDate" type="date"/>时间
    <input type="button" th:onclick="'javascript:save()'" value="提交" />
</form>
</body>
<script>
    function save() {
        $.ajax({
            type: 'POST',
            url: '/web/transfer/save',
            data: $.formJSON("saveTransferRecord"),
            success: function (data) {
                if (data.code == 0) {
                    alert(data.message);
                } else {
                    alert(data.message);
                }
            },
            error: function (data) {
                longp.alert("操作异常；请联系管理员！");
            }
        });
    }
</script>
</html>